import request from "../../utils/xlb-request/request";

// 发送验证码
export const reqSendCode = (phone) => {
	console.log("phone", phone);
	return request({
		method: "GET",
		url: `/user/passport/sendCode/${phone}`,
	});
};

// 注册
export const reqRegister = (data) => {
	return request({
		method: "POST",
		url: `/user/passport/register`,
		data,
	});
};

// 登录
export const reqLogin = (phone, password) => {
	return request({
		method: "POST",
		url: `/user/passport/login`,
		data: {
			phone,
			password,
		},
	});
};

// 退出登录
// 需要携带token参数
export const reqLogout = () => {
	return request({
		method: "GET",
		url: `/user/passport/logout`,
	});
};
